<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: PublicKeyPacket</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: PublicKeyPacket</h1>

    




<section>

<header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>PublicKeyPacket<span class="signature">(date<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h2>
        
            <div class="class-description"><p>Implementation of the Key Material Packet (Tag 5,6,7,14)</p>
<p><a href="https://tools.ietf.org/html/rfc4880#section-5.5">RFC4480 5.5</a>:
A key material packet contains all the information about a public or
private key.  There are four variants of this packet type, and two
major versions.</p>
<p>A Public-Key packet starts a series of packets that forms an OpenPGP
key (sometimes called an OpenPGP certificate).</p></div>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    
    <h2>Constructor</h2>
    

    
    <h4 class="name" id="PublicKeyPacket"><span class="type-signature"></span>new PublicKeyPacket<span class="signature">(date<span class="signature-attributes">opt</span>, config<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
    

    











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>date</code></td>
            

            <td class="type">
            
                
<span class="param-type">Date</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Creation date</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>config</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Full configuration, defaults to openpgp.config</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L38">line 38</a>
    </li></ul></dd>
    

    

    

    
</dl>




















    
    </div>

    

    

    

    

    

    

    
        <h3 class="subsection-title">Members</h3>

        
            
<h4 class="name" id="algorithm"><span class="type-signature"></span>algorithm<span class="type-signature"> :enums.publicKey</span></h4>




<div class="description">
    <p>Public key algorithm.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">enums.publicKey</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L62">line 62</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="created"><span class="type-signature"></span>created<span class="type-signature"> :Date</span></h4>




<div class="description">
    <p>Key creation date.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Date</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L57">line 57</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="expirationTimeV3"><span class="type-signature"></span>expirationTimeV3<span class="type-signature"> :Integer</span></h4>




<div class="description">
    <p>Time until expiration in days (V3 only)</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Integer</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L72">line 72</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="fingerprint"><span class="type-signature"></span>fingerprint<span class="type-signature"> :Uint8Array</span></h4>




<div class="description">
    <p>Fingerprint bytes</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Uint8Array</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L77">line 77</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="keyID"><span class="type-signature"></span>keyID<span class="type-signature"> :module:type/keyid~KeyID</span></h4>




<div class="description">
    <p>KeyID</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">module:type/keyid~KeyID</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L82">line 82</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="publicParams"><span class="type-signature"></span>publicParams<span class="type-signature"> :Object</span></h4>




<div class="description">
    <p>Algorithm specific public params</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Object</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L67">line 67</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="readPublicKey"><span class="type-signature"></span>readPublicKey<span class="type-signature"></span></h4>




<div class="description">
    <p>Alias of read()</p>
</div>







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L290">line 290</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="PublicKeyPacket.html#read">PublicKeyPacket#read</a></li>
        </ul>
    </dd>
    

    
</dl>






        
            
<h4 class="name" id="version"><span class="type-signature"></span>version<span class="type-signature"> :Integer</span></h4>




<div class="description">
    <p>Packet version</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Integer</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L52">line 52</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="writePublicKey"><span class="type-signature"></span>writePublicKey<span class="type-signature"></span></h4>




<div class="description">
    <p>Alias of write()</p>
</div>







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L297">line 297</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="PublicKeyPacket.html#write">PublicKeyPacket#write</a></li>
        </ul>
    </dd>
    

    
</dl>






        
    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    
    <h4 class="name" id="computeFingerprint"><span class="type-signature">(async) </span>computeFingerprint<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Computes and set the fingerprint of the key</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L231">line 231</a>
    </li></ul></dd>
    

    

    

    
</dl>




















        
            

    

    
    <h4 class="name" id="computeFingerprintAndKeyID"><span class="type-signature">(async) </span>computeFingerprintAndKeyID<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Computes and set the key ID and fingerprint of the key</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L215">line 215</a>
    </li></ul></dd>
    

    

    

    
</dl>




















        
            

    

    
    <h4 class="name" id="getAlgorithmInfo"><span class="type-signature"></span>getAlgorithmInfo<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
    

    



<div class="description">
    <p>Returns algorithm information</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L271">line 271</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>An object of the form {algorithm: String, bits:int, curve:String}.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Object</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getCreationTime"><span class="type-signature"></span>getCreationTime<span class="signature">()</span><span class="type-signature"> &rarr; {Date}</span></h4>
    

    



<div class="description">
    <p>Returns the creation time of the key</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L199">line 199</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Date</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getFingerprint"><span class="type-signature"></span>getFingerprint<span class="signature">()</span><span class="type-signature"> &rarr; {String}</span></h4>
    

    



<div class="description">
    <p>Calculates and returns the fingerprint of the key, as a string</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L255">line 255</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A string containing the fingerprint in lowercase hex</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">String</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getFingerprintBytes"><span class="type-signature"></span>getFingerprintBytes<span class="signature">()</span><span class="type-signature"> &rarr; {Uint8Array}</span></h4>
    

    



<div class="description">
    <p>Returns the fingerprint of the key, as an array of bytes</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L247">line 247</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>A Uint8Array containing the fingerprint</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Uint8Array</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="getKeyID"><span class="type-signature"></span>getKeyID<span class="signature">()</span><span class="type-signature"> &rarr; {module:type/keyid~KeyID}</span></h4>
    

    



<div class="description">
    <p>Return the key ID of the key</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L207">line 207</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>The 8-byte key ID</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">module:type/keyid~KeyID</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="hasSameFingerprintAs"><span class="type-signature"></span>hasSameFingerprintAs<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
    

    



<div class="description">
    <p>Calculates whether two keys have the same fingerprint without actually calculating the fingerprint</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L263">line 263</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Whether the two keys have the same version and public key data.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Boolean</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="isDecrypted"><span class="type-signature"></span>isDecrypted<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean|null}</span></h4>
    

    



<div class="description">
    <p>Check whether secret-key data is available in decrypted form. Returns null for public keys.</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L191">line 191</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Boolean</span>
|

<span class="param-type">null</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="read"><span class="type-signature">(async) </span>read<span class="signature">(bytes)</span><span class="type-signature"> &rarr; {Promise.&lt;number>}</span></h4>
    

    



<div class="description">
    <p>Internal Parser for public keys as specified in <a href="https://tools.ietf.org/html/rfc4880#section-5.5.2">RFC 4880 section 5.5.2 Public-Key Packet Formats</a></p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>bytes</code></td>
            

            <td class="type">
            
                
<span class="param-type">Uint8Array</span>


            
            </td>

            

            

            <td class="description last"><p>Input array to read the packet from</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L109">line 109</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>The number of bytes read from <code>bytes</code></p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Promise.&lt;number></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="write"><span class="type-signature"></span>write<span class="signature">()</span><span class="type-signature"> &rarr; {Uint8Array}</span></h4>
    

    



<div class="description">
    <p>Creates an OpenPGP public key packet for the given key.</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L157">line 157</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>Bytes encoding the public key OpenPGP packet.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Uint8Array</span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="writeForHash"><span class="type-signature"></span>writeForHash<span class="signature">(version)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Write packet in order to be hashed; either for a signature or a fingerprint</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>version</code></td>
            

            <td class="type">
            
                
<span class="param-type">Integer</span>


            
            </td>

            

            

            <td class="description last"><p>target version of signature or key</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L179">line 179</a>
    </li></ul></dd>
    

    

    

    
</dl>




















        
            

    

    
    <h4 class="name" id=".fromSecretKeyPacket"><span class="type-signature">(static) </span>fromSecretKeyPacket<span class="signature">(secretKeyPacket)</span><span class="type-signature"> &rarr; {<a href="PublicKeyPacket.html">PublicKeyPacket</a>}</span></h4>
    

    



<div class="description">
    <p>Create a PublicKeyPacket from a SecretKeyPacket</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>secretKeyPacket</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="SecretKeyPacket.html">SecretKeyPacket</a></span>


            
            </td>

            

            

            <td class="description last"><p>key packet to convert</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js">packet/public_key.js</a>, <a href="https://github.com/openpgpjs/openpgpjs/blob/v6.2.2/src/packet/public_key.js#L91">line 91</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>public key packet</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="PublicKeyPacket.html">PublicKeyPacket</a></span>


    </dd>
</dl>

    





        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Functions</h3><ul><li><a href="global.html#armor">armor</a></li><li><a href="global.html#createCleartextMessage">createCleartextMessage</a></li><li><a href="global.html#createMessage">createMessage</a></li><li><a href="global.html#decrypt">decrypt</a></li><li><a href="global.html#decryptKey">decryptKey</a></li><li><a href="global.html#decryptSessionKeys">decryptSessionKeys</a></li><li><a href="global.html#encrypt">encrypt</a></li><li><a href="global.html#encryptKey">encryptKey</a></li><li><a href="global.html#encryptSessionKey">encryptSessionKey</a></li><li><a href="global.html#generateKey">generateKey</a></li><li><a href="global.html#generateSessionKey">generateSessionKey</a></li><li><a href="global.html#readCleartextMessage">readCleartextMessage</a></li><li><a href="global.html#readMessage">readMessage</a></li><li><a href="global.html#readSignature">readSignature</a></li><li><a href="global.html#reformatKey">reformatKey</a></li><li><a href="global.html#revokeKey">revokeKey</a></li><li><a href="global.html#sign">sign</a></li><li><a href="global.html#unarmor">unarmor</a></li><li><a href="global.html#verify">verify</a></li></ul><h3>Modules</h3><ul><li><a href="module-config.html">config</a></li><li><a href="module-enums.html">enums</a></li></ul><h3>Classes</h3><ul><li><a href="AEADEncryptedDataPacket.html">AEADEncryptedDataPacket</a></li><li><a href="CleartextMessage.html">CleartextMessage</a></li><li><a href="CompressedDataPacket.html">CompressedDataPacket</a></li><li><a href="Key.html">Key</a></li><li><a href="LiteralDataPacket.html">LiteralDataPacket</a></li><li><a href="MarkerPacket.html">MarkerPacket</a></li><li><a href="Message.html">Message</a></li><li><a href="OnePassSignaturePacket.html">OnePassSignaturePacket</a></li><li><a href="PacketList.html">PacketList</a></li><li><a href="PaddingPacket.html">PaddingPacket</a></li><li><a href="PrivateKey.html">PrivateKey</a></li><li><a href="PublicKey.html">PublicKey</a></li><li><a href="PublicKeyEncryptedSessionKeyPacket.html">PublicKeyEncryptedSessionKeyPacket</a></li><li><a href="PublicKeyPacket.html">PublicKeyPacket</a></li><li><a href="PublicSubkeyPacket.html">PublicSubkeyPacket</a></li><li><a href="SecretKeyPacket.html">SecretKeyPacket</a></li><li><a href="SecretSubkeyPacket.html">SecretSubkeyPacket</a></li><li><a href="Signature.html">Signature</a></li><li><a href="SignaturePacket.html">SignaturePacket</a></li><li><a href="SymEncryptedIntegrityProtectedDataPacket.html">SymEncryptedIntegrityProtectedDataPacket</a></li><li><a href="SymEncryptedSessionKeyPacket.html">SymEncryptedSessionKeyPacket</a></li><li><a href="SymmetricallyEncryptedDataPacket.html">SymmetricallyEncryptedDataPacket</a></li><li><a href="TrustPacket.html">TrustPacket</a></li><li><a href="UserAttributePacket.html">UserAttributePacket</a></li><li><a href="UserIDPacket.html">UserIDPacket</a></li><li><a href="module-key_Subkey-Subkey.html">Subkey</a></li><li><a href="module-key_User-User.html">User</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>